# -*- coding:utf-8 -*-
# @Time:2024/4/1921:01
# @Author:miuzg
# @FileName:new test2.py
# @Software:PyCharm

import time
from selenium import webdriver
from selenium.webdriver.common.by import By

url = 'https://movie.douban.com/top250'
driver = webdriver.Edge()

driver.get(url)
while 1:
    # 写爬取数据操作
    try:
        driver.find_element(By.LINK_TEXT, '后页>').click()

    except Exception as e:
        print(e)
        print('数据获取完成')
        driver.quit()
        break
